<template>
  <div class="list-div">
    <div v-for="(item, index) in list" 
          :key="index"
          :class="['item', index != 0 ? 'top-border' : '']"
          @click="click(item.info)">
      <img :src="item.icon"></img>
      <span>{{item.info}}</span>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'Listdiv',
    props: {
      list: {
        type: Array,
        default() {
          return []
        }
      }
    },
    methods: {
      click(info) {
        this.$toast.show(info, 2000)
        this.$emit('collect', info)
      }
    }
  }
</script>

<style scoped>
.list-div {
  border-top: 15px solid #eee;
}
.top-border {
  border-top: 1px solid #eee;
}
.item {
  margin: 0 10px;
  padding: 10px 0;
  vertical-align: middle;
}

.item img {
  width: 23px;
  height: 23px;
  vertical-align: middle;
}
.item span {
  padding-left: 10px; 
  vertical-align: middle;
}
</style>